// 路由配置文件   路径---页面组件，之间的映射关系
import { createRouter, createWebHashHistory } from "vue-router";
import Account from "../views/account/index.vue";
import Category from "../views/category/index.vue";
import Product from "../views/product/index.vue";
import Prod from "../views/prod/index.vue";
import Dashboard from "../views/dashboard/index.vue";
import { GoldMedal, GoodsFilled, Histogram, PieChart, StarFilled, UserFilled } from "@element-plus/icons-vue";
import StarManager from "../views/StarManager.vue";

export const routes = [
  // 路径---页面组件
  {
    path: "/",
    component: Dashboard,
    meta: { title: "数据统计", icon: PieChart },
  },
  {
    path: "/account",
    component: Account,
    meta: { title: "账号管理", icon: UserFilled },
  },
  {
    path: "/category",
    component: Category,
    meta: { title: "分类管理", icon: Histogram },
  },
  {
    path: "/prod",
    component: Product,
    meta: { title: "商品管理", icon: GoodsFilled },
  },
  {
    path: "/star",
    component: StarManager,
    meta: { title: "明星管理", icon: StarFilled },
  },
  {
    path: "/product",
    component: Prod,
    meta: { title: "梵几管理", icon: GoldMedal },
  },
];

//创建路由对象
const router = createRouter({
  history: createWebHashHistory(), //路由模式，设置为哈希模式
  routes: routes,
});

//对外抛出路由对象
export default router;
